﻿<?php
// cWhois V1.77
// Copyright 2002 to 2005 Vibralogix
// You are licensed to use this on one domain only.
// Please email support@vibralogix.com for further details.

// List of who is servers for each domain type
// domain extension,whois server,not registered flag

$dtd[]=".ac,whois.nic.ac,no match";
$dtd[]=".af,whois.cocca.cx,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".com.ag,whois.nic.ag,not found";
$dtd[]=".edu.ag,whois.nic.ag,not found";
$dtd[]=".gov.ag,whois.nic.ag,not found";
$dtd[]=".net.ag,whois.nic.ag,not found";
$dtd[]=".org.ag,whois.nic.ag,not found";
$dtd[]=".ag,whois.nic.ag,not found";
$dtd[]=".am,whois.nic.am,no match";
$dtd[]=".as,whois.nic.as,not found";
$dtd[]=".ac.at,whois.nic.at,nothing found";
$dtd[]=".co.at,whois.nic.at,nothing found";
$dtd[]=".gv.at,whois.nic.at,nothing found";
$dtd[]=".or.at,whois.nic.at,nothing found";
$dtd[]=".at,whois.nic.at,nothing found";
$dtd[]=".asn.au,*auwhois,no data found";
$dtd[]=".com.au,*auwhois,no data found";
$dtd[]=".edu.au,whois.aunic.net,no entries";
$dtd[]=".id.au,*auwhois,no data found";
$dtd[]=".net.au,*auwhois,no data found";
$dtd[]=".org.au,*auwhois,no data found";
$dtd[]=".ac.be,*bewhois,free";
$dtd[]=".be,*bewhois, free";
$dtd[]=".bg,whois.ripe.net,no entries";
$dtd[]=".agr.br,whois.nic.br,no match";
$dtd[]=".am.br,whois.nic.br,no match";
$dtd[]=".art.br,whois.nic.br,no match";
$dtd[]=".com.br,whois.nic.br,no match";
$dtd[]=".coop.br,whois.nic.br,no match";
$dtd[]=".esp.br,whois.nic.br,no match";
$dtd[]=".etc.br,whois.nic.br,no match";
$dtd[]=".far.br,whois.nic.br,no match";
$dtd[]=".fm.br,whois.nic.br,no match";
$dtd[]=".g12.br,whois.nic.br,no match";
$dtd[]=".gov.br,whois.nic.br,no match";
$dtd[]=".imb.br,whois.nic.br,no match";
$dtd[]=".ind.br,whois.nic.br,no match";
$dtd[]=".inf.br,whois.nic.br,no match";
$dtd[]=".mil.br,whois.nic.br,no match";
$dtd[]=".net.br,whois.nic.br,no match";
$dtd[]=".org.br,whois.nic.br,no match";
$dtd[]=".psi.br,whois.nic.br,no match";
$dtd[]=".rec.br,whois.nic.br,no match";
$dtd[]=".srv.br,whois.nic.br,no match";
$dtd[]=".tmp.br,whois.nic.br,no match";
$dtd[]=".tur.br,whois.nic.br,no match";
$dtd[]=".tv.br,whois.nic.br,no match";
$dtd[]=".edu.br,whois.nic.br,no match";
$dtd[]=".nom.br,whois.nic.br,no match";
$dtd[]=".adm.br,whois.nic.br,no match";
$dtd[]=".adv.br,whois.nic.br,no match";
$dtd[]=".arq.br,whois.nic.br,no match";
$dtd[]=".ato.br,whois.nic.br,no match";
$dtd[]=".bio.br,whois.nic.br,no match";
$dtd[]=".bmd.br,whois.nic.br,no match";
$dtd[]=".cim.br,whois.nic.br,no match";
$dtd[]=".cng.br,whois.nic.br,no match";
$dtd[]=".cnt.br,whois.nic.br,no match";
$dtd[]=".ecn.br,whois.nic.br,no match";
$dtd[]=".eng.br,whois.nic.br,no match";
$dtd[]=".eti.br,whois.nic.br,no match";
$dtd[]=".fnd.br,whois.nic.br,no match";
$dtd[]=".fot.br,whois.nic.br,no match";
$dtd[]=".fst.br,whois.nic.br,no match";
$dtd[]=".ggf.br,whois.nic.br,no match";
$dtd[]=".jor.br,whois.nic.br,no match";
$dtd[]=".lel.br,whois.nic.br,no match";
$dtd[]=".mat.br,whois.nic.br,no match";
$dtd[]=".med.br,whois.nic.br,no match";
$dtd[]=".mus.br,whois.nic.br,no match";
$dtd[]=".not.br,whois.nic.br,no match";
$dtd[]=".ntr.br,whois.nic.br,no match";
$dtd[]=".odo.br,whois.nic.br,no match";
$dtd[]=".ppg.br,whois.nic.br,no match";
$dtd[]=".pro.br,whois.nic.br,no match";
$dtd[]=".psc.br,whois.nic.br,no match";
$dtd[]=".qsl.br,whois.nic.br,no match";
$dtd[]=".trd.br,whois.nic.br,no match";
$dtd[]=".vet.br,whois.nic.br,no match";
$dtd[]=".zlg.br,whois.nic.br,no match";
$dtd[]=".br,whois.nic.br,no match";
$dtd[]=".com.bz,whois.belizenic.bz,nomatch";
$dtd[]=".net.bz,whois.belizenic.bz,nomatch";
$dtd[]=".org.bz,whois.belizenic.bz,nomatch";
$dtd[]=".bz,whois.belizenic.bz,nomatch";
$dtd[]=".bc.ca,whois.cira.ca,status:         avail";
$dtd[]=".mb.ca,whois.cira.ca,status:         avail";
$dtd[]=".nb.ca,whois.cira.ca,status:         avail";
$dtd[]=".nf.ca,whois.cira.ca,status:         avail";
$dtd[]=".ns.ca,whois.cira.ca,status:         avail";
$dtd[]=".nt.ca,whois.cira.ca,status:         avail";
$dtd[]=".on.ca,whois.cira.ca,status:         avail";
$dtd[]=".pe.ca,whois.cira.ca,status:         avail";
$dtd[]=".qc.ca,whois.cira.ca,status:         avail";
$dtd[]=".sk.ca,whois.cira.ca,status:         avail";
$dtd[]=".yk.ca,whois.cira.ca,status:         avail";
$dtd[]=".ca,whois.cira.ca,status:         avail";
$dtd[]=".cd,whois.cd,no match";
$dtd[]=".cl,whois.nic.cl,no existe";
$dtd[]=".ch,whois.nic.ch,we do not have an entry";
$dtd[]=".co.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".edu.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".gov.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".net.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".org.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".cm,whois.ripe,no entries found";
$dtd[]=".edu.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ac.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ah.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".bj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".com.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cq.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gd.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gov.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gs.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gx.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gz.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hb.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".he.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hi.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hk.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hl.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".jl.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".js.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".mo.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".net.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".nm.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".nx.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ln.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".org.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".qh.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sc.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sh.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".tj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".tw.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".yn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".xj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".xz.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".zj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cx,whois.nic.cx,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".cz,whois.ripe.net,no data found";
$dtd[]=".de,*dewhois,status:      free";
$dtd[]=".dj,*djwhois,domain is available";
$dtd[]=".dk,whois.dk-hostmaster.dk,no entries";
$dtd[]=".dm,whois.nic.dm,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".com.ee,whois.eenet.ee,not found";
$dtd[]=".pri.ee,whois.eenet.ee,not found";
$dtd[]=".fie.ee,whois.eenet.ee,not found";
$dtd[]=".org.ee,whois.eenet.ee,not found";
$dtd[]=".med.ee,whois.eenet.ee,not found";
$dtd[]=".ee,whois.eenet.ee,not found";
$dtd[]=".fi,whois.ficora.fi,not found";
$dtd[]=".ac.fj,whois.usp.ac.fj,was not found";
$dtd[]=".biz.fj,whois.usp.ac.fj,was not found";
$dtd[]=".com.fj,whois.usp.ac.fj,was not found";
$dtd[]=".gov.fj,whois.usp.ac.fj,was not found";
$dtd[]=".info.fj,whois.usp.ac.fj,was not found";
$dtd[]=".mil.fj,whois.usp.ac.fj,was not found";
$dtd[]=".name.fj,whois.usp.ac.fj,was not found";
$dtd[]=".net.fj,whois.usp.ac.fj,was not found";
$dtd[]=".org.fj,whois.usp.ac.fj,was not found";
$dtd[]=".pro.fj,whois.usp.ac.fj,was not found";
$dtd[]=".school.fj,whois.usp.ac.fj,was not found";
$dtd[]=".fm,*fmwhois,no match";
$dtd[]=".fo,whois.rotld.ro,no entries";
$dtd[]=".asso.fr,whois.nic.fr,no entries";
$dtd[]=".com.fr,whois.nic.fr,no entries";
$dtd[]=".nom.fr,whois.nic.fr,no entries";
$dtd[]=".prd.fr,whois.nic.fr,no entries";
$dtd[]=".presse.fr,whois.nic.fr,no entries";
$dtd[]=".tm.fr,whois.nic.fr,no entries";
$dtd[]=".fr,whois.nic.fr,no entries";
$dtd[]=".co.gg,whois.isles.net,domain not found";
$dtd[]=".gov.gg,whois.isles.net,domain not found";
$dtd[]=".net.gg,whois.isles.net,domain not found";
$dtd[]=".org.gg,whois.isles.net,domain not found";
$dtd[]=".sch.gg,whois.isles.net,domain not found";
$dtd[]=".gg,whois.isles.net,domain not found";
$dtd[]=".gl,whois.ripe.net,no entries found";
$dtd[]=".gm,whois.ripe.net,no entries found";
$dtd[]=".gr,*grwhois,no match";
$dtd[]=".co.gr,*grwhois,no match";
$dtd[]=".com.gr,*grwhois,no match";
$dtd[]=".net.gr,*grwhois,no match";
$dtd[]=".edu.gr,*grwhois,no match";
$dtd[]=".gov.gr,*grwhois,no match";
$dtd[]=".org.gr,*grwhois,no match";
$dtd[]=".gs,whois.adamsnames.tc,not registered";
$dtd[]=".com.hk,whois.hkdnr.net.hk,not found";
$dtd[]=".edu.hk,whois.hkdnr.net.hk,not found";
$dtd[]=".gov.hk,whois.hkdnr.net.hk,not found";
$dtd[]=".net.hk,whois.hkdnr.net.hk,not found";
$dtd[]=".org.hk,whois.hkdnr.net.hk,not found";
$dtd[]=".hk,whois.hkdnr.net.hk,not found";
$dtd[]=".hm,whois.registry.hm,(null)";
$dtd[]=".co.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".info.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".org.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".priv.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".sport.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".tm.hu,whois.nic.hu,<!?>domain:";
$dtd[]=".hu,whois.nic.hu,<!?>domain:";
$dtd[]=".war.net.id,whois.idnic.net.id,no objects found";
$dtd[]=".web.id,whois.idnic.net.id,no objects found";
$dtd[]=".sch.id,whois.idnic.net.id,no objects found";
$dtd[]=".go.id,whois.idnic.net.id,no objects found";
$dtd[]=".ac.id,whois.idnic.net.id,no objects found";
$dtd[]=".co.id,whois.idnic.net.id,no objects found";
$dtd[]=".or.id,whois.idnic.net.id,no objects found";
$dtd[]=".net.id,whois.idnic.net.id,no objects found";
$dtd[]=".mil.id,whois.idnic.net.id,no objects found";
$dtd[]=".ie,whois.domainregistry.ie,no match";
$dtd[]=".ac.il,whois.isoc.org.il,no data was found";
$dtd[]=".co.il,whois.isoc.org.il,no data was found";
$dtd[]=".gov.il,whois.isoc.org.il,no data was found";
$dtd[]=".idf.il,whois.isoc.org.il,no data was found";
$dtd[]=".k12.il,whois.isoc.org.il,no data was found";
$dtd[]=".muni.il,whois.isoc.org.il,no data was found";
$dtd[]=".net.il,whois.isoc.org.il,no data was found";
$dtd[]=".org.il,whois.isoc.org.il,no data was found";
$dtd[]=".co.in,whois.inregistry.in,not found";
$dtd[]=".net.in,whois.inregistry.in,not found";
$dtd[]=".org.in,whois.inregistry.in,not found";
$dtd[]=".gen.in,whois.inregistry.in,not found";
$dtd[]=".firm.in,whois.inregistry.in,not found";
$dtd[]=".ind.in,whois.inregistry.in,not found";
$dtd[]=".in,whois.inregistry.in,not found";
$dtd[]=".io,whois.nic.io,no match";
$dtd[]=".ac.ir,whois.nic.ir,no entries found";
$dtd[]=".co.ir,whois.nic.ir,no entries found";
$dtd[]=".gov.ir,whois.nic.ir,no entries found";
$dtd[]=".id.ir,whois.nic.ir,no entries found";
$dtd[]=".net.ir,whois.nic.ir,no entries found";
$dtd[]=".org.ir,whois.nic.ir,no entries found";
$dtd[]=".sch.ir,whois.nic.ir,no entries found";
$dtd[]=".ir,whois.nic.ir,no entries found";
$dtd[]=".is,whois.isnet.is,no entries found";
$dtd[]=".it,whois.nic.it,no entries found";
$dtd[]=".je,whois.isles.net,domain not found";
$dtd[]=".ac.jp,whois.nic.ad.jp,no match";
$dtd[]=".ad.jp,whois.nic.ad.jp,no match";
$dtd[]=".co.jp,whois.nic.ad.jp,no match";
$dtd[]=".ed.jp,whois.nic.ad.jp,no match";
$dtd[]=".go.jp,whois.nic.ad.jp,no match";
$dtd[]=".ne.jp,whois.nic.ad.jp,no match";
$dtd[]=".or.jp,whois.nic.ad.jp,no match";
$dtd[]=".geo.jp,whois.nic.ad.jp,no match";
$dtd[]=".jp,whois.nic.ad.jp,no match";
$dtd[]=".ac.ke,whois.kenic.or.ke,no match";
$dtd[]=".co.ke,whois.kenic.or.ke,no match";
$dtd[]=".go.ke,whois.kenic.or.ke,no match";
$dtd[]=".ne.ke,whois.kenic.or.ke,no match";
$dtd[]=".or.ke,whois.kenic.or.ke,no match";
$dtd[]=".sc.ke,whois.kenic.or.ke,no match";
$dtd[]=".ac.kr,whois.krnic.net,domain name is not";
$dtd[]=".co.kr,whois.krnic.net,domain name is not";
$dtd[]=".go.kr,whois.krnic.net,domain name is not";
$dtd[]=".ne.kr,whois.krnic.net,domain name is not";
$dtd[]=".or.kr,whois.krnic.net,domain name is not";
$dtd[]=".pe.kr,whois.krnic.net,domain name is not";
$dtd[]=".re.kr,whois.krnic.net,domain name is not";
$dtd[]=".seoul.kr,whois.krnic.net,domain name is not";
$dtd[]=".kyonggi.kr,whois.krnic.net,domain name is not";
$dtd[]=".la,whois2.afilias-grs.net,not found";
$dtd[]=".li,whois.nic.li,do not have an entry";
$dtd[]=".lt,whois.ripe.net,no matches found";
$dtd[]=".lu,*luwhois,free";
$dtd[]=".asn.lv,whois.ripe.net,no entries found";
$dtd[]=".com.lv,whois.ripe.net,no entries found";
$dtd[]=".conf.lv,whois.ripe.net,no entries found";
$dtd[]=".edu.lv,whois.ripe.net,no entries found";
$dtd[]=".gov.lv,whois.ripe.net,no entries found";
$dtd[]=".id.lv,whois.ripe.net,no entries found";
$dtd[]=".mil.lv,whois.ripe.net,no entries found";
$dtd[]=".net.lv,whois.ripe.net,no entries found";
$dtd[]=".org.lv,whois.ripe.net,no entries found";
$dtd[]=".lv,whois.ripe.net,no entries found";
$dtd[]=".tm.mc,whois.ripe.net,no entries found";
$dtd[]=".asso.mc,whois.ripe.net,no entries found";
$dtd[]=".mc,whois.ripe.net,no entries found";
$dtd[]=".ms,whois.adamsnames.tc,not registered";
$dtd[]=".com.mt,whois.ripe.net,no entries found";
$dtd[]=".edu.mt,whois.ripe.net,no entries found";
$dtd[]=".net.mt,whois.ripe.net,no entries found";
$dtd[]=".org.mt,whois.ripe.net,no entries found";
$dtd[]=".tm.mt,whois.ripe.net,no entries found";
$dtd[]=".uu.mt,whois.ripe.net,no entries found";
$dtd[]=".mt,whois.ripe.net,no entries found";
$dtd[]=".com.mx,whois.nic.mx,no encontradas";
$dtd[]=".edu.mx,whois.nic.mx,no encontradas";
$dtd[]=".gob.mx,whois.nic.mx,no encontradas";
$dtd[]=".net.mx,whois.nic.mx,no encontradas";
$dtd[]=".org.mx,whois.nic.mx,no encontradas";
$dtd[]=".mx,whois.nic.mx,no encontradas";
$dtd[]=".com.my,whois.mynic.net.my,does not exist";
$dtd[]=".net.my,whois.mynic.net.my,does not exist";
$dtd[]=".org.my,whois.mynic.net.my,does not exist";
$dtd[]=".gov.my,whois.mynic.net.my,does not exist";
$dtd[]=".edu.my,whois.mynic.net.my,does not exist";
$dtd[]=".mil.my,whois.mynic.net.my,does not exist";
$dtd[]=".my,whois.mynic.net.my,does not exist";
$dtd[]=".nf,whois.nic.cx,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".nl,*nlwhois,is free";
$dtd[]=".no,whois.norid.no,no matches";
$dtd[]=".nu,whois.nic.nu,no match";
$dtd[]=".biz.pl,whois.dns.pl,no information";
$dtd[]=".com.pl,whois.dns.pl,no information";
$dtd[]=".net.pl,whois.dns.pl,no information";
$dtd[]=".org.pl,whois.dns.pl,no information";
$dtd[]=".info.pl,whois.dns.pl,no information";
$dtd[]=".pl,whois.dns.pl,no information";
$dtd[]=".pro,whois.registrypro.pro,unknown domain";
$dtd[]=".ac.nz,whois.domainz.net.nz,available";
$dtd[]=".co.nz,whois.domainz.net.nz,available";
$dtd[]=".cri.nz,whois.domainz.net.nz,available";
$dtd[]=".gen.nz,whois.domainz.net.nz,available";
$dtd[]=".govt.nz,whois.domainz.net.nz,available";
$dtd[]=".iwi.nz,whois.domainz.net.nz,available";
$dtd[]=".net.nz,whois.domainz.net.nz,available";
$dtd[]=".org.nz,whois.domainz.net.nz,available";
$dtd[]=".mil.nz,whois.domainz.net.nz,available";
$dtd[]=".pm,whois.nic.fr,no entries found";
$dtd[]=".school.nz,whois.domainz.net.nz,not listed";
$dtd[]=".re,whois.nic.fr,no entries found";
$dtd[]=".arts.ro,whois.rotld.ro,no entries";
$dtd[]=".com.ro,whois.rotld.ro,no entries";
$dtd[]=".firm.ro,whois.rotld.ro,no entries";
$dtd[]=".info.ro,whois.rotld.ro,no entries";
$dtd[]=".nom.ro,whois.rotld.ro,no entries";
$dtd[]=".nt.ro,whois.rotld.ro,no entries";
$dtd[]=".org.ro,whois.rotld.ro,no entries";
$dtd[]=".rec.ro,whois.rotld.ro,no entries";
$dtd[]=".store.ro,whois.rotld.ro,no entries";
$dtd[]=".tm.ro,whois.rotld.ro,no entries";
$dtd[]=".www.ro,whois.rotld.ro,no entries";
$dtd[]=".ro,whois.rotld.ro,no entries";
$dtd[]=".com.ru,whois.ripn.ru,no entries found";
$dtd[]=".net.ru,whois.ripn.ru,no entries found";
$dtd[]=".org.ru,whois.ripn.ru,no entries found";
$dtd[]=".ru,whois.ripn.ru,no entries found";
$dtd[]=".com.sa,*sawhois,not registered";
$dtd[]=".edu.sa,*sawhois,not registered";
$dtd[]=".gov.sa,*sawhois,not registered";
$dtd[]=".med.sa,*sawhois,not registered";
$dtd[]=".net.sa,*sawhois,not registered";
$dtd[]=".org.sa,*sawhois,not registered";
$dtd[]=".pub.sa,*sawhois,not registered";
$dtd[]=".sch.sa,*sawhois,not registered";
$dtd[]=".pp.se,whois.nic-se.se,no data found";
$dtd[]=".press.se,whois.nic-se.se,no data found";
$dtd[]=".org.se,whois.nic-se.se,no data found";
$dtd[]=".se,whois.nic-se.se,no data found";
$dtd[]=".com.sg,whois.nic.net.sg,nomatch";
$dtd[]=".edu.sg,whois.nic.net.sg,nomatch";
$dtd[]=".gov.sg,whois.nic.net.sg,nomatch";
$dtd[]=".net.sg,whois.nic.net.sg,nomatch";
$dtd[]=".org.sg,whois.nic.net.sg,nomatch";
$dtd[]=".per.sg,whois.nic.net.sg,nomatch";
$dtd[]=".com.sh,whois.nic.sh,no match";
$dtd[]=".co.sh,whois.nic.sh,no match";
$dtd[]=".net.sh,whois.nic.sh,no match";
$dtd[]=".org.sh,whois.nic.sh,no match";
$dtd[]=".edu.sh,whois.nic.sh,no match";
$dtd[]=".gov.sh,whois.nic.sh,no match";
$dtd[]=".mil.sh,whois.nic.sh,no match";
$dtd[]=".sh,whois.nic.sh,no match";
$dtd[]=".si,whois.arnes.si,no entries";
$dtd[]=".sk,whois.ripe.net,no entries found";
$dtd[]=".sm,whois.ripe.net,no entries found";
$dtd[]=".st,whois.nic.st,no entries found";
$dtd[]=".su,whois.ripn.net,no entries";
$dtd[]=".tc,whois.adamsnames.tc,not registered";
$dtd[]=".tf,whois.adamsnames.tc,not registered";
$dtd[]=".ac.th,whois.thnic.net,no entries found";
$dtd[]=".co.th,whois.thnic.net,no entries found";
$dtd[]=".go.th,whois.thnic.net,no entries found";
$dtd[]=".in.th,whois.thnic.net,no entries found";
$dtd[]=".mi.th,whois.thnic.net,no entries found";
$dtd[]=".net.th,whois.thnic.net,no entries found";
$dtd[]=".or.th,whois.thnic.net,no entries found";
$dtd[]=".tj,whois.nic.tj,no match for";
$dtd[]=".tk,whois.dot.tk,not known";
$dtd[]=".tl,whois.nic.tl,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".tm,whois.nic.tm,no match";
$dtd[]=".to,whois.tonic.to,no match";
$dtd[]=".tp,whois.nic.cx,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".bbs.tr,whois.metu.edu.tr,no match";
$dtd[]=".com.tr,whois.metu.edu.tr,no match";
$dtd[]=".edu.tr,whois.metu.edu.tr,no match";
$dtd[]=".gen.tr,whois.metu.edu.tr,no match";
$dtd[]=".gov.tr,whois.metu.edu.tr,no match";
$dtd[]=".k12.tr,whois.metu.edu.tr,no match";
$dtd[]=".mil.tr,whois.metu.edu.tr,no match";
$dtd[]=".net.tr,whois.metu.edu.tr,no match";
$dtd[]=".nom.tr,whois.metu.edu.tr,no match";
$dtd[]=".org.tr,whois.metu.edu.tr,no match";
$dtd[]=".web.tr,whois.metu.edu.tr,no match";
$dtd[]=".tv,*tvwhois,is available";
$dtd[]=".com.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".idv.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".net.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".org.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".com.ua,whois.com.ua,no entries found";
$dtd[]=".edu.ua,whois.com.ua,no entries found";
$dtd[]=".gov.ua,whois.com.ua,no entries found";
$dtd[]=".org.ua,whois.com.ua,no entries found";
$dtd[]=".net.ua,whois.com.ua,no entries found";
$dtd[]=".ua,whois.com.ua,no entries found";
$dtd[]=".co.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".or.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".sc.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".go.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ne.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.uk,whois.ja.net,no entries were found";
$dtd[]=".co.uk,whois.nic.uk,no match";
$dtd[]=".gov.uk,whois.ja.net,no entries were found";
$dtd[]=".ltd.uk,whois.nic.uk,no match";
$dtd[]=".me.uk,whois.nic.uk,no match";
$dtd[]=".net.uk,whois.nic.uk,no match";
$dtd[]=".org.uk,whois.nic.uk,no match";
$dtd[]=".plc.uk,whois.nic.uk,no match";
$dtd[]=".sch.uk,whois.nic.uk,no match";
$dtd[]=".uk.co,whois.uk.co,no matches";
$dtd[]=".us,whois.nic.us,not found";
$dtd[]=".va,whois.ripe.net,no entries found";
$dtd[]=".vg,whois.adamsnames.tc,not registered";
$dtd[]=".com.ws,whois.worldsite.ws,no match";
$dtd[]=".edu.ws,whois.worldsite.ws,no match";
$dtd[]=".gov.ws,whois.worldsite.ws,no match";
$dtd[]=".net.ws,whois.worldsite.ws,no match";
$dtd[]=".org.ws,whois.worldsite.ws,no match";
$dtd[]=".ws,whois.worldsite.ws,no match";
$dtd[]=".co.za,*zawhois,no matches";
$dtd[]=".au.com,whois.au.com,no domains";
$dtd[]=".br.com,whois.centralnic.com,no match";
$dtd[]=".cn.com,whois.centralnic.com,no match";
$dtd[]=".de.com,whois.centralnic.com,no match";
$dtd[]=".eu.com,whois.centralnic.com,no match";
$dtd[]=".eu.org,whois.eu.org,no entries found";
$dtd[]=".gb.com,whois.centralnic.com,no match";
$dtd[]=".gb.net,whois.centralnic.com,no match";
$dtd[]=".hu.com,whois.centralnic.com,no match";
$dtd[]=".no.com,whois.centralnic.com,no match";
$dtd[]=".qc.com,whois.centralnic.com,no match";
$dtd[]=".ru.com,whois.centralnic.com,no match";
$dtd[]=".sa.com,whois.centralnic.com,no match";
$dtd[]=".se.com,whois.centralnic.com,no match";
$dtd[]=".se.net,whois.centralnic.com,no match";
$dtd[]=".uk.com,whois.centralnic.com,no match";
$dtd[]=".uk.net,whois.centralnic.com,no match";
$dtd[]=".us.com,whois.centralnic.com,no match";
$dtd[]=".uy.com,whois.centralnic.com,no match";
$dtd[]=".za.com,whois.centralnic.com,no match";
$dtd[]=".za.net,whois.za.net,no such domain";
$dtd[]=".za.org,whois.za.net,no such domain";
$dtd[]=".aero,whois.information.aero,is not registered";
$dtd[]=".com,whois.crsnic.net,no match";
$dtd[]=".net,whois.crsnic.net,no match";
$dtd[]=".org,whois.publicinterestregistry.net,not found";
$dtd[]=".info,whois.afilias.net,not found";
$dtd[]=".museum,whois.museum,is available";
$dtd[]=".name,whois.nic.name,no match";
$dtd[]=".biz,whois.neulevel.biz,not found";
$dtd[]=".cc,whois.nic.cc,no match";
$dtd[]=".edu,whois.educause.net,no match";
$dtd[]=".mil,whois.nic.mil,no match";
$dtd[]=".int,whois.iana.org,not found";
$dtd[]=".coop,whois.nic.coop,no objects found";

function cWhois($dom,$domt,&$RegDetails)
{
  global $dtd;
  $dom=trim($dom);
  $domt=trim($domt);
  // Check referer
  if (1!=CheckReferer())
  {
    return(4); // Referer is  not allowed
  }
  $dom=accentstrtolower($dom);
  $domt=strtolower($domt);
  // Remove http://www. or www. if user added this
  if (strcmp("http://www.",substr($dom,0,11))==0)
  {
    $dom=substr($dom,11,strlen($dom)-11);
  }
  if (strcmp("www.",substr($dom,0,4))==0)
  {
    $dom=substr($dom,4,strlen($dom)-4);
  }
  // If $domt is blank then try to get it
  $found=0;
  if ($domt=="")
  {
    // Treat .name slightly differently
    if (substr($dom,strlen($dom)-5,5)==".name")
    {
      $domt=".name";
      $dom=substr($dom,0,strlen($dom)-5);
      $found=1;
    }
    else
    {
      // Get domain extension by taking everything from first '.'
      $pos=strpos($dom,".");
      if (is_integer($pos))
      {
        $pdomt=substr($dom,$pos,strlen($dom)-$pos);
      }
      for ($index=0;$index<count($dtd);$index++)
      {
        $dt=strtok($dtd[$index],",");
        if (strcasecmp($dt,$pdomt)==0)
        {
          $domt=$pdomt;
          $dom=substr($dom,0,strlen($dom)-strlen($dt));
          $found=1;
          break;
        }
      }
    }
    if ($found==0)
    {
      return(2); // Domain extension not recognised
    }
  }
  if (1!=CheckValidDomain($dom,$domt))
  {
    return(3); // Not a valid domain name
  }
  $serv="";
  for ($index=0;$index<count($dtd);$index++)
  {
    if (strtok($dtd[$index],",")==$domt)
    {
      $serv=strtok(",");
      $no=strtok(",");
      break;
    }
  }
  if ($serv=="")
  {
    return(2); // Domain type not recognised
  }
  $available=0;
  // Add support for domains that have no whois server but use a script to perform lookup.
  // Whois server is actually a function name flagged with a * as the first character which we remove.
  if (substr($serv,0,1)!="*")
  {
	  $noserv2=0;
	  if ($RegDetails=="*")
	  {
	    $RegDetails="";
	    $noserv2=1;
	  }
    //exec("whois -h $serv $dom$domt",$RegDetails,$ReturnValue);
    //exec("fwhois $dom$domt@$serv",$RegDetails,$ReturnValue);
    $rsck=wh($serv,$dom,$domt,$RegDetails,$buf);
  }
  else
  {
    $func=substr($serv,1,strlen($serv)-1);
    return($func($dom,$domt,$RegDetails)); // Return direct from handling function
  }
  // If checking .com or .net then also try whois.internic.net instead if failed
  if (($domt==".com") || ($domt==".net"))
  {
	  if ((count($RegDetails)<=1) || ($rsck==0))
	  {
	      $rsck=wh("whois.internic.net",$dom,$domt,$RegDetails,$buf);
			  if ((count($RegDetails)<=1) || ($rsck==0))
          return(5); // No connection of blocked etc for .com or .net
	  }
  }
  if ((count($RegDetails)==0) || ($rsck==0))
  {
    return(5); // No connection to whois server made
  }
  $serv2="";
  for($index=0;$index<count($RegDetails);$index++)
  {
    $lne=strtolower($RegDetails[$index]);
    $pos=strpos($lne,"whois server:");
    if (is_integer($pos))
    {
      $serv2=substr($lne,$pos+13,strlen($RegDetails[$index])-13);
      $serv2=trim($serv2);
    }
  }
  // Normally we check for a phrase that exists when domain name is not found.
  // First check to see if we are doing the reverse
  $no=str_replace("!!!dom!!!",$dom,$no);
  $no=str_replace("!!!domt!!!",$domt,$no);
  if (substr($no,0,4)=="<!?>")
  {
    $no=substr($no,4,strlen($no)-4);
  	$available=1;
    $pos=strpos(strtolower($buf),$no);
    if (is_integer($pos))
    {
      $available=0;
    }
  }
  else
  {
  	$available=0;
    $pos=strpos(strtolower($buf),$no);
    if (is_integer($pos))
    {
      $available=1;
    }
	}
  if ($available==1)
  {
    return(0); // Domain is not registered
  }
  if ($noserv2==1)
    return(1); // Return now as full whois not required for the following extensions
  if (($domt==".com") || ($domt==".net") || ($domt==".org") || ($domt==".cc"))
  {
    if ($serv2!="")
    {
      // exec("whois -h $serv2 $dom$domt",$RegDetails,$ReturnValue);
      // exec("fwhois $dom$domt@$serv2",$RegDetails,$ReturnValue);
      $rsck=wh($serv2,$dom,$domt,$RegDetails2,$buf2);
			// if checking .com or .net and whois fails then try whois.networksolutions.com instead
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
		    if (($domt==".com") || ($domt==".net"))
        {
	  	    $rsck=wh("whois.networksolutions.com",$dom,$domt,$RegDetails2,$buf2);
        }
      }
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
        return(1); // No connection to second whois server made but return that domain is registered
      }
      $RegDetails=$RegDetails2;
      $buf=$buf2;
    }
  }
  return(1); // Domain is registered
}

function wh($serv,$dom,$domt,&$regdet,&$buf)
{
	$IDN = new idna_convert();
  $regdet="";
  $timeout=10.0;
  $stoptime=time()+$timeout;
  $connection=@fsockopen($serv,43,$errorno,$errordesc,$timeout);
  if ($connection)
  {
//		stream_set_timeout($connection, $timeout);
    // If necessary create punycode from domain name
    if (($domt==".no") || ($domt==".ch") || ($domt==".li") || ($domt==".at") || ($domt==".se") || ($domt==".com") || ($domt==".net"))
    {
	  	$idndom = $IDN->encode($dom.$domt);
    	fputs($connection,"$idndom\r\n");
    }
    else
    {
    	fputs($connection,"$dom$domt\r\n");
    }
    $timedout=0;
	  $buf="";
	  do
	  {
	   $buf1 = fread($connection, 100000);
	   if (strlen($buf1) == 0)
	   {
	       break;
	   }
	   $buf .= $buf1;
	  }
	  while (true);
    fclose($connection);
    $regdet=explode("\n",$buf);
  	return(1);
  }
  else
    return(0);
}

function CheckReferer()
{
  global $HTTP_REFERER,$allowed;
  if ($allowed=="")
  {
    return(1); // Don't care who called us
  }
  $ref=strtolower($HTTP_REFERER);
  $allowed=strtolower($allowed);
  $refall=split(",",$allowed,100);
  for ($index=0;$index<count($refall);$index++)
  {
    $pos=strpos($HTTP_REFERER,$refall[$index]);
    if (is_integer($pos))
    {
      if ($pos==0)
      {
        return(1); // Referer allowed access
      }
    }
  }
  return(0);
}

function CheckValidDomain($dom,$domt)
{
  $dom=accentstrtolower($dom);
  $domt=strtolower($domt);
  // Handle .name seperately
  if ($domt==".name")
  {
		if (is_integer(strpos($dom,".")))
		{
			$section=explode(".",$dom);
	    $first=$section[0];
	    $last=$section[1];
	    if (isset($section[2]))
	      return(0);
			if (ereg("^[-a-zA-Z0-9]{1,63}$",$first)!=True)
				return(0);
			if (($first[0]=="-") || ($first[strlen($first)-1]=="-"))
				return(0);
			if (ereg("^[-a-zA-Z0-9]{3,63}$",$last)!=True)
				return(0);
			if (($last[0]=="-") || ($last[strlen($last)-1]=="-"))
				return(0);
		}
		else
		{
	    if (ereg("^[-a-zA-Z0-9]{3,63}$",$dom)!=True)
		    return(0);
	    if (($dom[0]=="-") || ($dom[strlen($dom)-1]=="-"))
		    return(0);
		}
		return(1);
  }
  // .ac.uk, .gov.uk, .ltd.uk, .plc.uk and .sch.uk do not allow 1 character domain names
  if (($domt==".ac.uk") || ($domt==".gov.uk") || ($domt==".ltd.uk") || ($domt==".plc.uk") || ($domt==".sch.uk"))
  {
    if (strlen($dom)<=1)
      return(0);
  }
  // .co.uk, .me.uk, .org.uk and .net.uk do not allow 1 character domain names
  if (($domt==".co.uk") || ($domt==".me.uk") || ($domt==".org.uk") || ($domt==".net.uk"))
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // .info and .biz dont allow 1 and 2 character domain names
  if (($domt==".info") || ($domt==".biz"))
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // .jp does not allow 1 and 2 character domain names
  if ($domt==".jp")
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // generic string of allowed characters
 	$validmask="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-";
  if ($domt==".no")
  	$validmask="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-".chr(225).chr(224).chr(226).chr(231).chr(233).chr(232).chr(234).chr(241).chr(243).chr(242).chr(244).chr(246).chr(252).chr(248).chr(229).chr(230);
  if ($domt==".dk")
  	$validmask="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-".chr(248).chr(229).chr(230);
  if ($domt==".se")
  	$validmask="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-".chr(228).chr(229).chr(246).chr(233).chr(252);
  if (($domt==".ch") || ($domt==".li") || ($domt==".de") || ($domt==".at") || ($domt==".com") || ($domt==".net"))
  {
  	$validmask="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-";
  	for ($k=224;$k<=246;$k++)
  	  $validmask=$validmask.chr($k);
  	for ($k=248;$k<=255;$k++)
  	  $validmask=$validmask.chr($k);
  }
  if (strspn($dom, $validmask) != strlen($dom))
    return(0);
  if (($dom[0]=="-") || ($dom[strlen($dom)-1]=="-"))
    return(0);
  return(1);
}

function accentstrtolower($s)
{
	for ($k=0;$k<strlen($s);$k++)
	{
		$c=ord($s[$k]);
		if (($c>=65) && ($c<=90))
			$c=$c+32;
		if (($c>=192) && ($c<=214))
			$c=$c+32;
		if (($c>=216) && ($c<=222))
			$c=$c+32;
		$s[$k]=chr($c);
	}
	return($s);
}

function sendToHost($host,$method,$path,$data,&$buf,$useragent=0)
{
  // Supply a default method of GET if the one passed was empty
  if (empty($method))
  	$method = 'GET';
  $method = strtoupper($method);
  $fp = fsockopen($host,80);
  if ($method == 'GET')
  	$path .= '?' . $data;
  fputs($fp, "$method $path HTTP/1.1\n");
  fputs($fp, "Host: $host\n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
  fputs($fp, "Content-length: " . strlen($data) . "\n");
  if ($useragent)
  	fputs($fp, "User-Agent: MSIE\n");
  fputs($fp, "Connection: close\n\n");
  if ($method == 'POST')
  	fputs($fp, $data);
  while (!feof($fp))
  	$buf[]=fgets($fp,128);
  fclose($fp);
  return $buf;
}

function sendToHost2($host,$method,$path,$data,&$buf,$useragent=0)
{
  // Reads webpage in one big buffer
  // Supply a default method of GET if the one passed was empty
  if (empty($method))
  	$method = 'GET';
  $method = strtoupper($method);
  $fp = fsockopen($host,80);
  if ($method == 'GET')
  	$path .= '?' . $data;
  fputs($fp, "$method $path HTTP/1.1\n");
  fputs($fp, "Host: $host\n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
  fputs($fp, "Content-length: " . strlen($data) . "\n");
  if ($useragent)
  	fputs($fp, "User-Agent: MSIE\n");
  fputs($fp, "Connection: close\n\n");
  if ($method == 'POST')
  	fputs($fp, $data);
 	$buf=fread($fp,100000);
  fclose($fp);
  return $buf;
}

function sawhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!($fh=@fopen("http://www.saudinic.net.sa/cgi-bin/whois.cgi?Domain=".$dom."&Level=".$domt,"r")))
    return(5);
  $buf="";
  while (!feof($fh))
  	$buf[]=fgets($fh,128);
  fclose($fh);
  $fnd=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $buf[$k]=strip_tags($buf[$k]);
    $buf[$k]=trim($buf[$k]);
    $pos=strpos($buf[$k],$dom.$domt);
    $pos2=strpos($buf[$k],"@saudinic.net.sa");
    if ((is_integer($pos)) && (is_integer($pos2)==False))
      $fnd=1;
    if ($fnd==1)
      $regdet[]=$buf[$k];
  }
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"not registered");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function eswhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!($fh=@fopen("http://ineco.nic.es/cgi-bin/consulta.whois?list=Dominios&key=".$dom.$domt."&tipo=procesar","r")))
    return(5);
  $buf="";
	$buf=fread($fh,100000);
  fclose($fh);
  $buf=eregi_replace("</tr>","\n",$buf);
  $buf=strip_tags($buf);
  $buf2=explode("\n",$buf);
	$blankflag=0;
  for ($k=0;$k<count($buf2);$k++)
  {
    $buf2[$k]=trim($buf2[$k]);
    if (($buf2[$k]!="") && (strlen($buf2[$k])>1))
    {
    	$blankflag=0;
      $regdet[]=$buf2[$k];
    }
    if (($buf2[$k]=="") && ($blankflag==0))
    {
    	$blankflag=1;
      $regdet[]=$buf2[$k];
    }
  }
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"encontrado");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function fmwhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!($fh=@fopen("http://www.dot.fm/whois.cfm?domain=".$dom.$domt,"r")))
    return(5);
  $buf="";
	$buf=fread($fh,100000);
  fclose($fh);
  $buf=strip_tags($buf);
  $buf2=explode("\n",$buf);
	$blankflag=0;
  for ($k=0;$k<count($buf2);$k++)
  {
    $buf2[$k]=trim($buf2[$k]);
    if (($buf2[$k]!="") && (strlen($buf2[$k])>1))
    {
    	$blankflag=0;
      $regdet[]=$buf2[$k];
    }
    if (($buf2[$k]=="") && ($blankflag==0))
    {
    	$blankflag=1;
      $regdet[]=$buf2[$k];
    }
  }
  $available=0;
	$premium="";
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"no match");
    if (is_integer($pos))
    {
      $available=1;
    }
    $pos=strpos($lne,"1st year registration:");
    if (is_integer($pos))
    {
      $premium=substr($lne,$pos+24,strlen($lne)-$pos-24);
    }
  }
  if ($premium!="")
  {
  	$premium=sprintf("%01.2f",$premium);
    $regdet[]=$premium;
    return(6); // Return available at premium
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function tvwhois($dom,$domt,&$regdet)
{
  $regdet="";
//  if (!($fh=@fopen("http://www.tv/en-def-5e58a43774d2/cgi-bin/multilookup.cgi?domain=".$dom."&tv=1","r")))
  if (!($fh=@fopen("http://www.tv/en-def-1b7db09f553d/cgi-bin/multilookup.cgi?domain=".$dom."&tld=tv&x=25&y=5","r")))
  {
    return(5);
  }
  $buf="";
	do
	{
   $buf1 = fread($fh, 100000);
   if (strlen($buf1) == 0)
   {
       break;
 	 }
   $buf .= $buf1;
	}
 	while (true);
  fclose($fh);
  $buf=strip_tags($buf);
  $pos=strpos($buf,$dom.$domt." is not available");
  if (is_integer($pos))
  {
		$regdet[]=$dom.$domt."  is not available";
	  $regdet[]="Full whois for ".$domt." domains not available";
    return(1);
  }
  $pos=strpos($buf,$dom.$domt."  is available");
  if (is_integer($pos))
  {
		$regdet[]=$dom.$domt." is available";
    return(0);
  }
  $pos=strpos($buf,$dom.$domt."    is an available premium name");
  if (is_integer($pos))
  {
		$regdet[]=$dom.$domt." is an available premium name";
	  $pos=strpos($buf,"$",$pos);
	  $pos2=strpos($buf," ",$pos);
		$premium=substr($buf,$pos+1,$pos2-$pos-1);
	  $premium=eregi_replace(",","",$premium);
  	$premium=sprintf("%01.2f",$premium);
    $regdet[]=$premium;
    return(6);
  }
  return(1);
}

function djwhois($dom,$domt,&$regdet)
{
  $regdet="";
  sendToHost('www.dj-domains.com','post','/chk/index.php','domain_name='.$dom,$buf);
  if (count($buf)==0)
    return(5); // No connection to whois server made
  $available=0;
  $premium=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $pos=strpos(strtolower($buf[$k]),"domain is available");
    if (is_integer($pos))
      $available=1;
    // See if premium domain
    $pos=strpos(strtolower($buf[$k]),"this is a \"premium\" domain name");
    if (is_integer($pos))
      $premium=1;
    // Get premium price
    $pos=strpos(strtolower($buf[$k]),"dname=".$dom."&price=");
    if (is_integer($pos))
    {
	    $pos2=strpos(strtolower($buf[$k]),",",$pos);
      $price=substr($buf[$k],$pos+strlen("dname=".$dom."&price="),$pos2-$pos-strlen("dname=".$dom."&price=")+3);
      $price=strtr($price,",",".");
    }
  }
  // If whois not contactable
  if (($premium==1) && ($available==1))
  {
    $regdet[]="Domain is available at a premium. Price in Euro's is ".$price;
    $regdet[]=$price;
    return(6);
  }
  if ($available==1)
  {
    $regdet[]=$dom.".dj is available";
    return(0);
  }
  if (($available==0) && ($regdet!="*"))
  {
	  sendToHost2('www.dj-domains.com','post','/whois/index.php','whoisdname='.$dom."&action=chk_whois",$buf);
	  $buf=eregi_replace("<br>","\n",$buf);
	  $buf=strip_tags($buf);
	  $buf2=explode("\n",$buf);
    $start=0;
    $finish=0;
    for ($k=0;$k<count($buf2);$k++)
    {
    	if (($start==1) && (trim($buf2[$k])!=""))
      	$regdet[]=$buf2[$k];
	    $pos=strpos(strtolower($buf2[$k]),"result:");
  	  if (is_integer($pos))
				$start=1;
	    $pos=strpos(strtolower($buf2[$k]),"name server:");
  	  if (is_integer($pos))
				$finish=1;
      if (($finish==1) && (trim($buf2[$k])==""))
        break;
    }
  }
  return(1);
}

function bewhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
	  $regdet="";
	  $connection=@fsockopen("whois.dns.be",4343,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,"GET 1.0 $dom\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne," free");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
  else
  {
	  $regdet="";
	  $connection=@fsockopen("whois.dns.be",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"no such domain");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
}

function nlwhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
	  $regdet="";
	  $connection=@fsockopen("whois.domain-registry.nl",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,"Is ".$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<1)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"is free");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
  else
  {
	  $regdet="";
	  $connection=@fsockopen("whois.domain-registry.nl",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"not a registered domain");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
}
function luwhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
	  $regdet="";
	  $connection=@fsockopen("whois.dns.lu",4343,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,"GET 1.0 $dom\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne," free");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
  else
  {
	  $regdet="";
	  $connection=@fsockopen("whois.dns.lu",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"no such domain");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
}
function dewhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
	  $regdet="";
	  $connection=@fsockopen("whois.denic.de",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,"-C ISO-8859-1 ".$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"status:      free");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
  else
  {
	  $regdet="";
	  $connection=@fsockopen("whois.denic.de",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,"-C ISO-8859-1 -T dn ".$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"not found in database");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
}
function auwhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
	  $regdet="";
	  $connection=@fsockopen("whois-check.ausregistry.net.au",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<1)
	      return(5);
      $registered=0;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"not available");
	      if (is_integer($pos))
        {
	        $registered=1;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
  else
  {
	  $regdet="";
	  $connection=@fsockopen("whois.ausregistry.net.au",43,$errorno,$errordesc);
	  if ($connection)
	  {
	    fputs($connection,$dom.$domt."\r\n");
	    while(!feof($connection))
	    {
	      $regdet[]=fgets($connection,255);
	    }
	    fclose($connection);
	    if (count($regdet)<2)
	      return(5);
      $registered=1;
	    for($index=0;$index<count($regdet);$index++)
	    {
	      $lne=strtolower($regdet[$index]);
	      $pos=strpos($lne,"no data found");
	      if (is_integer($pos))
        {
	        $registered=0;
          break;
        }
	    }
      return($registered);
	  }
	  else
	    return(5);
  }
}
function zawhois($dom,$domt,&$regdet)
{
  if (!($fh=@fopen("http://co.za/cgi-bin/whois.sh?Domain=".$dom,"r")))
  {
    return(5);
  }
  $buf="";
	do
	{
   $buf1 = fread($fh, 100000);
   if (strlen($buf1) == 0)
   {
       break;
 	 }
   $buf .= $buf1;
	}
 	while (true);
  fclose($fh);
  $pos=strpos($buf,"No Matches");
  if (!is_integer($pos))
  {
	  $pos=strpos($buf,"0a.");
	  if (is_integer($pos))
	  {
	    $buf=substr($buf,$pos);
	    $regdet=explode("\n",$buf);
	  }
	  return(1); // Not available
  }
  return(0); // Available
}

function grwhois($dom,$domt,&$regdet)
{
	global $grusername,$grpassword;
  $regdet="";
	if (!($fh=fopen("http://www.papaki.gr/server.aspx?message=<request><username>$grusername</username><password>$grpassword</password><type>domainSearch</type><lang>el</lang><test>False</test><domain>$dom</domain><extensions><ext>$domt</ext></extensions></request>","rb")))
	{
		return(5);
	}
	$contents = fread ($fh, 100000);
	fclose ($fh);
	$code=getxmldata($contents,"code");
	if ($code!="1000")
	{
	  return(5);
	}
	$available=getxmldata($contents,"availableDomains");
	if ($available!="")
	{
		$available=getxmldata($available,"domain");
		if (is_integer(strpos($available,$dom.$domt)))
		{
			$regdet[]=$dom.$domt." is available";
	  	$regdet[]="Full whois for ".$domt." domains not available";
    	return(0); // domain available
  	}
  }
  $regdet[]=$dom.$domt." is not available";
  $regdet[]="Full whois for ".$domt." domains not available";
  return(1); // domain not available
}
function getxmldata($contents,$tag)
{
	$tag=strtolower($tag);
  $contentslower=strtolower($contents);
  $pos = strpos($contentslower, "<".$tag.">");
  $pos2 = strpos($contentslower, "</".$tag.">");
  if ((is_integer($pos)) && (is_integer($pos2)))
    return( substr($contents, $pos + strlen($tag)+2, $pos2 - $pos-(strlen($tag)+2)));
  else
  	return("");
}


/* ------------------------------------------------------------------------- */
/* idna_convert.class.php - Encode / Decode punycode based domain names      */
/* (c) 2004 blue birdy, Berlin (http://bluebirdy.de)                         */
/* All rights reserved                                                       */
/* v0.1.5                                                                    */
/* ------------------------------------------------------------------------- */
class idna_convert
{
    // Internal settings, do not mess with them
    var $punycode_prefix = 'xn--';
    var $invalid_ucs =     0x80000000;
    var $max_ucs =         0x10ffff;
    var $base =            36;
    var $tmin =            1;
    var $tmax =            26;
    var $skew =            38;
    var $damp =            700;
    var $initial_bias =    72;
    var $initial_n =       0x80;
    var $error =           FALSE;

    // The constructor
    function idna_convert()
    {
        return TRUE;
    }

    // Decode a given Domain name
    function decode($encoded)
    {
        // Clean up input
        $encoded = trim($encoded);
        // Call actual wrapper
        return $this->_do_job($encoded, 'decode');
    }

    // Encode a given Domain name
    function encode($decoded)
    {
        // Clean up input
        $decoded = preg_replace('!?', 'ss', strtolower(trim($decoded)));
        // Call actual wrapper
        return $this->_do_job($decoded, 'encode');
    }

    // Use this method to get the last error ocurred
    function get_last_error()
    {
        return $this->error;
    }

    // Wrapper class to provide extended functionality
    // This allows for processing complete email addresses and domain names
    function _do_job($input, $mode)
    {
        $method = '_'.$mode;
        // Maybe it is an email address
        if (strpos($input, '@')) {
            list($email_pref, $input) = explode('@', $input, 2);
            $email_pref .= '@';
        } else {
            $email_pref = '';
        }
        // Process any substring
        $arr = explode('.', $input);
        foreach($arr as $k => $v) {
            $conv = $this->$method($v);
            if ($conv) $arr[$k] = $conv;
        }
        return $email_pref . join('.', $arr);
    }

    // The actual decoding algorithm
    function _decode($encoded)
    {
        // We do need to find the Punycode prefix
        if (!preg_match('!^'.preg_quote($this->punycode_prefix, '!').'!', $encoded)) {
            $this->_error('This is not a punycode string');
            return FALSE;
        }
        $encode_test = preg_replace('!^'.preg_quote($this->punycode_prefix, '!').'!', '', $encoded);
        // If nothing left after removing the prefix, it is hopeless
        if (!$encode_test) {
            $this->_error('The given encoded string was empty');
            return FALSE;
        }
        // Find last occurence of the delimiter
        $delim_pos = strrpos($encoded, '-');
        $decoded = ($delim_pos > strlen($this->punycode_prefix))
                 ? substr($encoded, strlen($this->punycode_prefix), ($delim_pos - strlen($this->punycode_prefix)))
                 : '';

        $deco_len = strlen($decoded);
        $enco_len = strlen($encoded);

        // Wandering through the strings; init
        $is_first = TRUE;
        $bias     = $this->initial_bias;
        $idx      = 0;
        $char     = $this->initial_n;

        //while ($enco_idx < $enco_len) {
        for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
            for ($old_idx = $idx, $w = 1, $k = $this->base; 1 ; $k += $this->base) {
                $digit = $this->_decode_digit($encoded{$enco_idx++});
                $idx += $digit * $w;
                $t = ($k <= $bias) ? $this->tmin :
                        (($k >= $bias + $this->tmax) ? $this->tmax : ($k - $bias));
                if ($digit < $t) break;
                $w = (int) ($w * ($this->base - $t));
            }
            $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
            $is_first = FALSE;
            $char += ($idx / ($deco_len + 1)) % 256;
            $idx %= ($deco_len + 1);
            if ($deco_len) {
                for ($i = $deco_len; $i > $idx; $i--) {
                    $decoded{$i} = $decoded{($i - 1)};
                }
            }
            $decoded{$idx++} = chr($char);
        }
        return $decoded;
    }

    // The actual encoding algorithm
    function _encode($decoded)
    {
        // No empty strings please
        if (!$decoded) {
            $this->_error('The given decoded string was empty');
            return FALSE;
        }
        // We cannot encode a domain name containing the Punycode prefix
        if (preg_match('!^'.preg_quote($this->punycode_prefix, '!').'!', $decoded)) {
            $this->_error('This is already a punycode string');
            return FALSE;
        }
        // We will not try to encode strings containing of basic code points only
        if (!preg_match('![\x80-\xff]!', $decoded)) {
            $this->_error('The given string does not contain encodable chars');
            return FALSE;
        }

        $deco_len  = strlen($decoded);
        $codecount = 0; // How many chars have been consumed

        // Start with the prefix; copy it to output
        $encoded = $this->punycode_prefix;
        // Copy all basic code points to output
        for ($i = 0; $i < $deco_len; ++$i) {
            if (preg_match('![0-9a-zA-Z-]!', $decoded{$i})) {
                $encoded .= $decoded{$i};
                $codecount++;
            }
        }
        // If we have basic code points in output, add an hyphen to the end
        if ($codecount) $encoded .= '-';

        // Now find and encode all non-basic code points
        $is_first  = TRUE;
        $cur_code  = $this->initial_n;
        $bias      = $this->initial_bias;
        $delta     = 0;
        while ($codecount < $deco_len) {
            // Find the smallest code point >= the current code point and
            // remember the last ouccrence of it in the input
            for ($i = 0, $next_code = $this->max_ucs; $i < $deco_len; $i++) {
                if (ord($decoded{$i}) >= $cur_code && ord($decoded{$i}) <= $next_code) {
                    $next_code = ord($decoded{$i});
                }
            }

            $delta += ($next_code - $cur_code) * ($codecount + 1);
            $cur_code = $next_code;

            // Scan input again and encode all characters whose code point is $cur_code
            for ($i = 0; $i < $deco_len; $i++) {
                if (ord($decoded{$i}) < $cur_code) {
                    $delta++;
                } elseif (ord($decoded{$i}) == $cur_code) {
                    for ($q = $delta, $k = $this->base; 1; $k += $this->base) {
                        $t = ($k <= $bias) ? $this->tmin :
                                (($k >= $bias + $this->tmax) ? $this->tmax : $k - $bias);
                        if ($q < $t) break;
                        $encoded .= $this->_encode_digit(ceil($t + (($q - $t) % ($this->base - $t))));
                        $q = ($q - $t) / ($this->base - $t);
                    }
                    $encoded .= $this->_encode_digit($q);
                    $bias = $this->_adapt($delta, $codecount+1, $is_first);
                    $codecount++;
                    $delta = 0;
                    $is_first = FALSE;
                }
            }
            $delta++;
            $cur_code++;
        }
        return $encoded;
    }

    // Adapt the bias according to the current code point and position
    function _adapt($delta, $npoints, $is_first)
    {
        $delta = $is_first ? ($delta / $this->damp) : ($delta / 2);
        $delta += $delta / $npoints;
        for ($k = 0; $delta > (($this->base - $this->tmin) * $this->tmax) / 2; $k += $this->base) {
            $delta = $delta / ($this->base - $this->tmin);
        }
        return $k + ($this->base - $this->tmin + 1) * $delta / ($delta + $this->skew);
    }

    //
    function _encode_digit($d)
    {
        return chr($d + 22 + 75 * ($d < 26));
    }

    //
    function _decode_digit($cp)
    {
        $cp = ord($cp);
        return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->base));
    }

    // Internal error handling method
    function _error($error = '')
    {
        $this->error = $error;
    }
}
?>